#include "AbsUI/ProjectView.hpp"
#include "Ctrl/ProjectController.hpp"
#include "Model/Project.hpp"
#include <boost/lambda/lambda.hpp>
#include <boost/lambda/bind.hpp>

namespace AbsUI
{


ProjectView::ProjectView( Ctrl::ProjectController& ctrler )
	: rCtrler_( ctrler)
{
	using namespace boost::lambda;
	rCtrler_.subscribeToProjectChanged( bind( &ProjectView::projectChangeSlot, this, _1));
	rCtrler_.subscribeToProjectDescriptionChange( bind( &ProjectView::projectDescriptionChangedSlot, this, _1));
}

// ---------------------------------------------------------------------------------------------------------------------

ProjectView::~ProjectView()
{
}

// ---------------------------------------------------------------------------------------------------------------------

void ProjectView::projectChangeSlot( Model::Project* newProject )
{
	this->changeProject( newProject);
}

// ---------------------------------------------------------------------------------------------------------------------

void ProjectView::projectDescriptionChangedSlot( const Model::Project& changedProject )
{
	this->changeProjectDescription( changedProject);
}


} // namespace AbsUI
